package interview.shence;

import java.util.*;

/**
 * Question3
 *
 * @author <a href="zhaoyingling12@163.com">Zhao Simon</a>
 * @description:
 * @date 2021/4/29
 **/
public class Question3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        String[] strings = str.split(",");
        int[] nums = new int[strings.length];
        for (int i = 0; i < strings.length; ++i) {
            nums[i] = Integer.valueOf(strings[i].trim());
        }
        if (nums.length == 1) {
            System.out.println(nums[0]);
            return;
        }
        Arrays.sort(nums);
        int len = nums.length;
        int mid = len / 2;
        if (len % 2 == 0) {
            System.out.println((nums[mid] + nums[mid - 1]) / 2);
        } else {
            System.out.println(nums[mid]);
        }
    }
}
